#include "bits/stdc++.h"
using namespace std;
typedef long long LL;
const int MAXN = 100010;
struct Node {
    int l, r;
    LL lazy;
    LL sum;
} segTree[MAXN * 4];
void build(int i, int l, int r) {
    segTree[i].l = l;
    segTree[i].r = r;
    if (l == r) {
        segTree[i].sum=0;
      //  scanf("%lld", &segTree[i].sum);
        return;
    }
    int mid = l + r >> 1;
    build(i << 1, l, mid);
    build(i << 1 | 1, mid + 1, r);
    segTree[i].sum = segTree[i << 1].sum + segTree[i << 1 | 1].sum;
}
void push_up(int i, LL v) {
    segTree[i].sum += (segTree[i].r - segTree[i].l + 1) * v;
    segTree[i].lazy += v;
}
void push_down(int i) {
    if (segTree[i].l == segTree[i].r) return;
    push_up(i << 1, segTree[i].lazy);
    push_up(i << 1 | 1, segTree[i].lazy);
    segTree[i].lazy = 0;
}
void add(int i, int l, int r, LL v) {
    if (segTree[i].l >= l && segTree[i].r <= r) {
        push_up(i, v);
        return;
    }
    push_down(i);
    int mid = segTree[i].l + segTree[i].r >> 1;
    if (mid >= l) add(i << 1, l, r, v);
    if (mid < r) add(i << 1 | 1, l, r, v);
    segTree[i].sum = segTree[i << 1].sum + segTree[i << 1 | 1].sum;
}
LL query(int i, int l, int r) {
    if (segTree[i].l == l && segTree[i].r == r) return segTree[i].sum;
    push_down(i);
    int mid = segTree[i].l + segTree[i].r >> 1;
    if (r <= mid) return query(i << 1, l, r);
    else if (l > mid) return query(i << 1 | 1, l, r);
    else return query(i << 1, l, mid) + query(i << 1 | 1, mid + 1, r);
}
void solve(){
    string s;
    cin>>s;
    int l = 0;
    int r = 0;
    double ans = 0;
    while ((r = s.find('+', l)) != -1) {
        string ss = s.substr(l, r - l);
        if (-1 != ss.find('d')) {
            string ss1 = ss.substr(0, ss.find('d'));
            string ss2 = ss.substr(ss.find('d') + 1, ss.size());
            int a = strtol(ss1.c_str(), NULL, 10);
            double b = strtol(ss2.c_str(), NULL, 10);
            ans += a * (1 + b) * 0.5;
        }
        else {
            int a = strtol(ss.c_str(), NULL, 10);
            ans += a;
        }
        l = r + 1;
    }
    string ss = s.substr(l, s.size());
    if (-1 != ss.find('d')) {
        string ss1 = ss.substr(0, ss.find('d'));
        string ss2 = ss.substr(ss.find('d') + 1, ss.size());
        int a = strtol(ss1.c_str(), NULL, 10);
        double b = strtol(ss2.c_str(), NULL, 10);
        ans += a * (1 + b) * 0.5;
    }
    else {
        int a = strtol(ss.c_str(), NULL, 10);
        ans += a;
    }
    LL d = ans;
    if (ans - d > 1e-6) {
        printf("%.1f", ans);
    }
    else
        printf("%lld", d);
}
int main() {

    
    build(1, 1, 1000);
    build(1,1,100);
    build(1,1,500);
    solve();
    build(1, 1, 1000);
    return 0;
}

